<%@ Control Language="C#" AutoEventWireup="true" CodeFile="userlist.ascx.cs" Inherits="forums_controls_misc_userlist" %>
<%@ Register Src="Pager.ascx" TagName="Pager" TagPrefix="uc1" %>
<p>
<a href="default.aspx">FSTDT Forums</a> . Members
</p>
<uc1:Pager ID="Pager1" runat="server" />
<asp:GridView runat="server" ID="gridUsers" AutoGenerateColumns="false" Width="100%" GridLines="None">
    <Columns>
        <asp:TemplateField>
            <ItemTemplate>
                <asp:Image runat="server" ID="imgAvatar"
                    ImageAlign="AbsMiddle"
                    ImageUrl='<%# Helpers.StringHelper.SafeFormat("~/forums/avatars/{0}.{1}", Eval("ID"), Eval("AvatarExtension")) %>'
                    Visible='<%# !String.IsNullOrEmpty(Eval("AvatarExtension") as string) && Convert.ToBoolean(Eval("AdminSettings.AllowAvatar")) == true %>'
                />
                <asp:HyperLink runat="server" ID="lnkProfile"
                    Text='<%# Helpers.StringHelper.SafeFormat(Eval("Username")) %>'
                    NavigateUrl='<%# Helpers.StringHelper.SafeFormat("~/forums/profile.aspx?u={0}", Eval("ID")) %>'
                />
            </ItemTemplate>
            <HeaderTemplate>
                Username
            </HeaderTemplate>
            <ItemStyle Width="50%" VerticalAlign="middle" />
        </asp:TemplateField>
        <asp:TemplateField>
            <ItemTemplate>
                <%# Helpers.StringHelper.SafeFormat(Eval("TotalThreads")) %>
            </ItemTemplate>
            <HeaderTemplate>
                Threads Started
            </HeaderTemplate>
            <HeaderStyle Width="10%" HorizontalAlign="Center" />
            <ItemStyle HorizontalAlign="Center" VerticalAlign="middle" />
        </asp:TemplateField>
        <asp:TemplateField>
            <ItemTemplate>
                <%# Helpers.StringHelper.SafeFormat(Eval("TotalPosts")) %>
            </ItemTemplate>
            <HeaderTemplate>
                Total Posts
            </HeaderTemplate>
            <HeaderStyle Width="10%" HorizontalAlign="Center" />
            <ItemStyle HorizontalAlign="Center" VerticalAlign="middle" />
        </asp:TemplateField>
        <asp:TemplateField>
            <ItemTemplate>
                <asp:HyperLink runat="server" ID="lnkPM"
                    Text="Send Private Message"
                    NavigateUrl='<%# Helpers.StringHelper.SafeFormat("~/forums/usercp.aspx?newpm={0}", Eval("ID")) %>'
                />
            </ItemTemplate>
            <HeaderStyle Width="30%" HorizontalAlign="Right" />
            <ItemStyle HorizontalAlign="Right" VerticalAlign="middle" />
        </asp:TemplateField>
    </Columns>
    <EmptyDataTemplate>
        No users, waaaaaah!
    </EmptyDataTemplate>
    <AlternatingRowStyle CssClass="forum_altgridrow" />
</asp:GridView>
<uc1:Pager ID="Pager2" runat="server" />